package nl.memedefense.tower.ui;

import nl.memedefense.tower.TowerUpgradeStatus;
import nl.memedefense.tower.Tower;

/**
 * Concrete {@link nl.memedefense.tower.Tower} implementation. A ShoopDaWoop tower is the most 'basic' of all towers. It can only target
 * ground units and can only target one unit at once.
 *
 * @author Robin van Breukelen
 */
public class ShoopDaWoopTower extends Tower {

    private static final float BASE_DAMAGE = 2;
    private static final float PRICE = 10;

    private TowerUpgradeStatus level;

    /**
     * Constructs a new ShoopDaWoopTower with default values.
     */
    public ShoopDaWoopTower() {
        this.level = TowerUpgradeStatus.BASIC;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public float getBaseDamage() {
        return BASE_DAMAGE;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public TowerUpgradeStatus getLevel() {
        return level;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void upgrade(TowerUpgradeStatus nextLevel) {
        if (nextLevel.compareTo(level) > 0) {
            this.level = nextLevel;
        }

    }

    /**
     * {@inheritDoc}
     */
    @Override
    public TowerUpgradeStatus getNextLevel() {
        TowerUpgradeStatus nextLevel;
        switch (level) {
            default:
                nextLevel = TowerUpgradeStatus.BASIC;
        }
        return nextLevel;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public float getPrice() {
        return PRICE;
    }
}
